<?php 
class MemberAction extends Action{
	public function index(){
		$this->display();
	}
	public function login(){
		if($_POST['username'] & $_POST['password']){
			$query = mysql_query("select username,password from user where username = '$username' and password = '$password' ");
			$_SESSION ['username'] = $_POST['username'];
			$_SESSION ['password'] = $_POST['password'];
			echo "<script type='text/javascript'>window.location.href='../'</script>";
		}else{
			echo "<script>登陆失败！</script>";
		}
	}
	public function logout(){
		$_SESSION=array();
		if (session_id() != "" || isset($_COOKIE[session_name()])){
			setcookie(session_name(), '', time()-2592000, '/');
			session_destroy();
			echo "<script type='text/javascript'>window.location.href='../'</script>";
		}
	}
}
?>